From: svermeul@suntzu.psg.datap.ca (Stephen Vermeulen)
Message-Id: <199602272146.OAA10008@alien.psg.datap.ca>
To: mui@sunsite.Informatik.RWTH-Aachen.DE
Subject: Re: Let's go Virtual!
X-Sun-Charset: US-ASCII
Resent-Message-Id: <"QuuXi1.0.XA3._mtCn"@sunsite>
Resent-From: mui@sunsite.Informatik.RWTH-Aachen.DE
Reply-To: mui@sunsite.Informatik.RWTH-Aachen.DE
X-Mailing-List:  archive/latest/432
X-Loop: mui@sunsite.informatik.rwth-aachen.de
Precedence: list
Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.DE
Content-Type: text
Content-Length: 1999
X-Lines: 59
Status: RO

>   Please help me!
>   I have created a VirtualGroup and have Text and Space objects in it. And when I change the
> contence of the group the scrollbars aren't updated. I also noticed that if I resize the
> window the scrollers get updated. So, what can I do to tell the VirtualGroup to update
> it's size and scrollbars??
> I can find only customclass related redraw commands from the autodocs...
> This is a huge problem, ofcourse what do I need a VirtualGroup for if I can't scroll it!?
>
>  - Jarkko "WhyJ" Ylipaavalniemi -

I have found two ways of working around this, although I would classify
at least one as a "hack".

Use the official way: the MUIM_Group_InitChange function:

    NAME
        MUIM_Group_InitChange (V11)

    SYNOPSIS
        DoMethod(obj,MUIM_Group_InitChange,);

    FUNCTION
        Prepares a group for dynamic adding/removing of objects.
        MUI 3 offers the possibility to dynamically add/remove
        children from groups, even when the window that contains
        these objects is currently open. To be able to do this,
        you must first put the group into a special "exchange"
        state by using this method. Then, you can add/remove
        children at will. If you're done, use MUIM_Group_ExitChange
        to make MUI recalculate the display.

    RESULT
        returns NULL on failure.

    EXAMPLE
        /* remove two children, add another one */

        if (DoMethod(group,MUIM_Group_InitChange))
        {
           /* since we just want the group to refresh it's
              idea of how big it is we don't need these lines...

              DoMethod(group,OM_REMMEMBER,somechild);
              DoMethod(group,OM_REMMEMBER,somechild2);
              DoMethod(group,OM_ADDMEMBER,somenewchild);
           */

           DoMethod(group,MUIM_Group_ExitChange);
        }

The other way of doing this works with older versions of MUI,
just do a "hide/show" on the virtual group object after you have
changed its contents.

There is probably a third way of doing this by using the new
custom layout hooks within the group class.

Regards, Stephen